In the fields of data processing or automatic control, the comparison of data expressed as numerical values and the classification of the magnitudes thereof is extremely important.
These include, for example, the determination of the larger of two numbers, the selection, from a plurality of input data, of data having the maximum value, or the arrangement by size and numerical value of a plurality of data, that is to say, sorting, etc.
Such separations can be conducted using a standard calculator; however, in order to conduct a large number of calculations, a large period of time is required, and this is thus very difficult to use in real-time control. In particular, in the case of use in the control of robots or the like, installation in the robots is required, so that realization in terms of a small LSI chip has been desired.
Using a microprocessor, when the programming thereof was attempted, an enormous amount of time was required, so that the application thereof was essentially impossible. Research and development has been conducted in order to produce a circuit which conducts direct magnitude comparison by means of hardware; however, a great number of elements are required for the realization of such a circuit and because calculations are carried out via a number of stages of circuits, large-scale integration which is small in size and is capable of high speed calculation has not yet been realized.
The present invention has as an object thereof to provide a semiconductor device which is capable of carrying out calculations for comparing the magnitude of a plurality of data at high speed using simple circuitry.